package org.jeecg.modules.rental.service.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.iot.api.IControlAPI;
import org.jeecg.modules.iot.req.CloseSocketReq;
import org.jeecg.modules.iot.req.OpenSocketReq;
import org.jeecg.modules.rental.service.ICtrlSocketService;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class CtrlSocketService implements ICtrlSocketService {

    private final IControlAPI controlApi;


    @Override
    public Integer queryPort(String deviceCode) {
        return controlApi.queryPort(deviceCode);
    }

    @Override
    public Result openPort(OpenSocketReq req) {
        return controlApi.openPort(req);
    }

    @Override
    public Result closePort(CloseSocketReq req) {
        return controlApi.closePort(req);
    }
}
